//
//  JiangLiJinTableViewCell.m
//  wangzhe
//
//  Created by 李 佳伟 on 2017/11/14.
//  Copyright © 2017年 李 佳伟. All rights reserved.
//

#import "JiangLiJinTableViewCell.h"
#import "JTCSM.h"
static CGFloat space = 20;
static CGFloat viewsize = 15;
static CGFloat top = 15;
static CGFloat labelHeight = 20;
@interface JiangLiJinTableViewCell (){
    CGFloat width;
}

@end

@implementation JiangLiJinTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        width = KSCREENWidth-2*space;
        
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(space, top, viewsize, viewsize)];
        view.backgroundColor = RGBACOLOR(241, 241, 241, 1);
        [self.contentView addSubview:view];
        [df layerWithView:view radius:viewsize/2 width:0 color:nil];
        if ([reuseIdentifier integerValue] == 0) {
            UIView *line = [[UIView alloc]initWithFrame:CGRectMake(space+(viewsize-2)/2, 0, 2, top)];
            line.backgroundColor = RGBACOLOR(241, 241, 241, 1);
            [self.contentView addSubview:line];
        }
        
        UIView *line = [[UIView alloc]initWithFrame:CGRectMake(space+(viewsize-2)/2, KVIEW_Y(view), 2, top+labelHeight*2-viewsize)];
        line.backgroundColor = RGBACOLOR(241, 241, 241, 1);
        [self.contentView addSubview:line];
        
        self.nameLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(view)+space, top, width/2-KVIEW_X(view)-space, labelHeight) text:@"莉莉" font:16 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(89, 89, 89, 1) backgroundColor:nil];
        [self.contentView addSubview:self.nameLabel];
        
        self.moneyLabel = [UILabel initWithFrame:CGRectMake(width/2, top, width/2-space, labelHeight) text:@"+20.00元" font:16 textAlignment:NSTextAlignmentRight texcolor:RGBACOLOR(227, 72, 40, 1) backgroundColor:nil];
        [self.contentView addSubview:self.moneyLabel];
        
        self.timeLabel = [UILabel initWithFrame:CGRectMake(KVIEW_X(view)+space, KVIEW_Y(_nameLabel), width/2-KVIEW_X(view)-space, labelHeight) text:@"2017-11-14 16:32" font:16 textAlignment:NSTextAlignmentLeft texcolor:RGBACOLOR(133, 133, 133, 1) backgroundColor:nil];
        [self.contentView addSubview:self.timeLabel];

        
    }
    
    return self;
}

@end
